package java6681.task;

import java.util.Comparator;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author Junichiro
 * @description 提取单词表测试
 * @date 2021-04-05 20:26
 **/

public class test {
    public static void main(String[] args) {
        String str = "hello，你好HELLO HOW ,Tree\n" +
                "排序sort set tree\n" +
                "123 456 hello123\n" +
                "View\n" +
                "VIEW Controller 1CONTROLLER5\n" +
                "(TreeSet) Collection** ArrayList\n" +
                "arraylist List%\n";
        String s = "[a-zA-Z]+";
        TreeSet<String> list = new TreeSet<>();
        Pattern  pattern= Pattern.compile(s);
        Matcher ma=pattern.matcher(str.toLowerCase());
        while (ma.find()){
            list.add(ma.group());
        }
        for (String s1 : list) {
            System.out.println(s1);
        }
    }
}
